﻿using System;
using Autodesk.Revit.DB;

namespace ModelChecking.ElementCollisionChecking
{
	public class ComponentInfo
	{
		public ElementId ComponentId
		{
			get
			{
				return this.m_ComponentId;
			}
		}

		public string ComponentTypeName
		{
			get
			{
				return this.m_ComponentTypeName;
			}
		}

		public string LevelName
		{
			get
			{
				return this.m_LevelName;
			}
		}

		public ElementId CollisionComponentId
		{
			get
			{
				return this.m_CollisionComponentId;
			}
		}

		public ComponentInfo(ComponentInfo rhs)
		{
			this.m_ComponentId = rhs.m_ComponentId;
			this.m_ComponentTypeName = rhs.m_ComponentTypeName;
			this.m_LevelName = rhs.m_LevelName;
			this.m_CollisionComponentId = rhs.m_CollisionComponentId;
		}

		public ComponentInfo(ElementId componentId, string componentTypeName, string levelName, ElementId collisionComponentId)
		{
			this.m_ComponentId = componentId;
			this.m_ComponentTypeName = componentTypeName;
			this.m_LevelName = levelName;
			this.m_CollisionComponentId = collisionComponentId;
		}

		public bool IsEqual(ComponentInfo other)
		{
			return (this.ComponentId.IntegerValue == other.ComponentId.IntegerValue && this.CollisionComponentId.IntegerValue == other.CollisionComponentId.IntegerValue) || (this.ComponentId.IntegerValue == other.CollisionComponentId.IntegerValue && this.CollisionComponentId.IntegerValue == other.ComponentId.IntegerValue);
		}

		private ElementId m_ComponentId;

		private string m_ComponentTypeName;

		private string m_LevelName;

		private ElementId m_CollisionComponentId;
	}
}
